﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///CulBefore 的摘要说明
/// </summary>
public class CulBefore:IBeforeDoing
{
    public CulBefore()
    {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }

    #region IBeforeDoing 成员

    public void BeforeInsert()
    {
        string thistitle = HttpContext.Current.Request.Form["title_EditShow$titletxt"];
        string sql = "select count (*) from cul where title='" + thistitle.ToSql() + "'";
        int count = int.Parse(DBFactory.GetConn().exe1(sql));
        if (count > 0)
        {
            string script = "<script>alert ('已有此标题文化');history.go(-1)</script>";
            HttpContext.Current.Response.Write(script);
            HttpContext.Current.Response.End();
        }
    }

    public void BeforeUpdate(string PkValue)
    {
        throw new NotImplementedException();
    }

    public void BeforeDelete(string PkValue)
    {
        throw new NotImplementedException();
    }

    #endregion
}
